package com.tianchi.lexiang.background;

import com.tianchi.lexiang.R;
import com.tianchi.lexiang.background.adapter.OsdSettingAdapter;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ListView;

public class OsdSetting extends Activity implements OnClickListener {

	private ListView osdSettingList;

	private Button newIncreasedBtn;
	private Button backBtn;

	public static OsdSettingAdapter mAdapter;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.osd_setting);
		initView();
	}
	
	private void initView() {
		osdSettingList = (ListView) findViewById(R.id.osd_setting_list);
		mAdapter = new OsdSettingAdapter(this);
		osdSettingList.setAdapter(mAdapter);
		mAdapter.startQueryAlreadyPonit();

		newIncreasedBtn = (Button) findViewById(R.id.new_increased_btn);
		newIncreasedBtn.setOnClickListener(this);
		backBtn = (Button) findViewById(R.id.back_btn);
		backBtn.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		int id = v.getId();
		switch (id) {
		case R.id.new_increased_btn:
			Intent intent = new Intent();
			intent.setClass(OsdSetting.this, AddOsd.class);
			startActivity(intent);
			break;
		case R.id.back_btn:
			OsdSetting.this.finish();
			break;

		default:
			break;
		}
	}
}
